<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<style>
			 .mui-table h4,.mui-table h5,.mui-table .mui-h5,.mui-table .mui-h6,.mui-table p{
		        margin-top: 0;
		    }
		    .mui-table h4{
		        line-height: 21px;
		        font-weight: 500;
		    }
		
		    .mui-table .oa-icon{
		        position: absolute;
		        right:0;
		        bottom: 0;
		    }
		    .mui-table .oa-icon-star-filled{
		        color:#f14e41;
		    }
		</style>
	</head>

	<body>
		<div class="mui-content">

			<ul id="scList" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
					</ul>
			<!--模板-->
			<div id="CollectionModel" style="display: none;">
				<li class="mui-table-view-cell" id="${id}">
		            <div class="mui-table">
		                <div class="mui-table-cell mui-col-xs-10">
		                    <h4 class="mui-ellipsis">${title} </h4>
		                    <h5>${cb:source} ${cb:author}</h5>
		                     
		                </div>
		                <div class="mui-table-cell mui-col-xs-2 mui-text-right">
		                    <span class="mui-h5">${add_time}</span>
		                </div>
		            </div>
		        </li>
				
			</div>
			<div id="CollectionModel2" style="display: none;">
				<li class="mui-table-view-cell">
					<div class="mui-card" data-id="${id}">
						<div class="mui-card-header mui-card-media">

							<div class="mui-media-body">
								<h4>${title} 
							<span class="mui-icon ">
		                    	
		                    	<svg class="iconzs xianqing fbtime" >
 									 <use xlink:href="#icon-qianjin"></use>
								</svg>
		                    	
		                   </span>	
						</h4>

								<p>${cb:source} ${cb:author} <span class="fbtime">${time}</span></p>
							</div>

						</div>

						<!--<div class="mui-card-footer">
							<a class="mui-card-link">
								<span class="mui-icon">
		                    	
		                    	<svg class="iconzs" >
 									 <use xlink:href="#icon-zhuanfa"></use>
								</svg>
		                    	${cb:appShareCount}
		                   </span>
							</a>
							<a class="mui-card-link">
								<span class="mui-icon">
		                    	
		                    	<svg class="iconzs" >
 									 <use xlink:href="#icon-yuedu"></use>
								</svg>
		                    	${click}
		                   </span>
							</a>
							<a class="mui-card-link">
								<span class="mui-icon">
		                    	
		                    	<svg class="iconzs" >
 									 <use xlink:href="#icon-shoucangweixuan"></use>
								</svg>
		                    	${cb:appCollectionCount}
		                   </span>
							</a>
						</div>-->
					</div>
				</li>
			</div>

			<!--模板 end-->
		</div>

		<script type="text/javascript" src="../../js/lib/template.js"></script>
		<script type="text/javascript" src="../../js/Common.js"></script>
		<script type="text/javascript" src="../../js/static.js"></script>
		<script src="../../js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init();

			if(isLogin()) {
				mui.post('http://app.99990158.com/Article/GetCollection', {
					'userId': GetLoginUserInfo().LoginId
				}, function(data) {

					var list = [];
					mui.each(data, function(index, element) {
						if(element.Info)
							list.push(JSON.parse(element.Info));
					});

					var t = document.getElementById('CollectionModel').innerHTML;
					var res = tmpl(t, list, tmpl_count(list), tmpCallBack);

					document.getElementById('scList').innerHTML = res;

					 
				}, 'json');
			}

			 
			mui('.mui-table-view').on('tap','.mui-table-view-cell',function(){
				console.log( this.id);
				openWindowWithTitle('../newsneiy.html?id=' + this.id, '文章详情');
			});

			function tmpCallBack(a, b) {

				switch(b[1]) {
					case "appShareCount":
						if(a.fields.appShareCount) {
							return a.fields.appShareCount
						}
						return 0;
						break;
					case "appCollectionCount":
						if(a.fields.appCollectionCount) {
							return a.fields.appCollectionCount
						}
						return 0;
						break;

					case "source":
						if(a.fields.source) {
							return a.fields.source
						}
						return "";
						break;

					case "author":
						if(a.fields.author) {
							return a.fields.author
						}
						return "";
						break;

					default:

						break;
				}
				return '';
			}
		</script>
	</body>

</html>